﻿using System;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Collections.Generic;
using System.Data;
using CoreEA;
namespace SqlCeViewer.CommonMethod
{
    public interface IDbEnginer:IDisposable
    {
        bool OpenDatabase(string dbName, string pwd, OpenModeClass curOpenMode);
        bool CreateDataBase(string dbName, string pwd, bool Encrypt);
        bool CreateDataBase(string dbName);
        bool CreateDataBase(string dbName, string pwd);

        bool OpenDatabase(string dbName, string pwd);
        bool OpenDatabase(string dbName);

        bool CreateTableWithSchemaInfo(object args, string tableName);
        Database DbHandler { get;  }
        DataSet GetColumnInfoFromTable(string tableName);
        DataSet GetIndexInfoFromTable(string tableName);
        DataSet GetKeyColumnInfoFromTable(string tableName);
        DataSet GetProviderInfoFromTable(string tableName);
        DataSet GetSupportedDbType();
        List<string> GetColumnNameListFromTable(string tableName);
        List<string> GetIndexNameListFromTable(string tableName);

        List<string> GetTableList();
        List<string> TableList { get; }
        bool InsertData(string tableName, List<string> columnName, List<string> columnValue, List<DbType> types);

        int GetTableMaxLength
        {
            get;
        }
        bool ExecuteSimpleCommand(string cmd);

        /// <summary>
        /// Speical for Access 
        /// </summary>
        ICoreEAHander CustomHandler { get; }

        Dictionary<string, DbType> GetColumnNameAndTypeFromTable(string item);
    }
}
